import { Link, Route, Routes, NavLink, useRoutes } from "react-router-dom";
import { useSelector, useDispatch } from "react-redux";
import Login from "./views/login"; // 确保这里的导入路径正确  Age
import Age from "./views/age"; // 确保这里的导入路径正确  Age
import "./App.css"; // 确保这里的导入路径正确  Age
import { route } from "./route/index"

const App = () => { // 将APP改为App，以符合React组件命名惯例  
  const count = useSelector(state => state.counter.value);
  const dispatch = useDispatch();
  const element = useRoutes(route)
  return (
    <div>
      <NavLink to="/login?id=12&title=32" className={({ isActive }) => isActive ? "list-group-item active" : "list-group-item"}>Demo</NavLink>
      <NavLink to="/age" className={({ isActive }) => isActive ? "list-group-item active" : "list-group-item"}>Demo</NavLink>

      {element}
    </div >
  );
};

export default App; // 导出时使用小写app，但在JSX中引用时通常使用大写App（如果遵循驼峰命名）